<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/%E6%AD%A6%E6%B1%8932x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/%E6%AD%A6%E6%B1%8916x16.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib1/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib1/pace/pace-theme-center-simple.min.css">
  <script src="/lib1/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"example.com","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="优化与深度学习一般会预定义一个损失函数，再使用优化算法试图将其最小化，这样的损失函数通常被称为优化问题的目标函数，通常只考虑最小化目标函数。由于优化算法的目标函数通常是一个基于训练集的损失函数，故优化目的在于降低训练误差，而深度学习目的在于降低泛化误差，因此需要注意过拟合问题。 很多优化问题并不存在解析解，因此需要通过优化算法有限次迭代模型参数来尽可能降低损失函数值。 局部最小值当一个优化问题的数">
<meta property="og:type" content="article">
<meta property="og:title" content="优化算法与计算性能">
<meta property="og:url" content="http://example.com/2020/08/28/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E4%BC%98%E5%8C%96%E7%AE%97%E6%B3%95/index.html">
<meta property="og:site_name" content="Technological Blog">
<meta property="og:description" content="优化与深度学习一般会预定义一个损失函数，再使用优化算法试图将其最小化，这样的损失函数通常被称为优化问题的目标函数，通常只考虑最小化目标函数。由于优化算法的目标函数通常是一个基于训练集的损失函数，故优化目的在于降低训练误差，而深度学习目的在于降低泛化误差，因此需要注意过拟合问题。 很多优化问题并不存在解析解，因此需要通过优化算法有限次迭代模型参数来尽可能降低损失函数值。 局部最小值当一个优化问题的数">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-08-28T04:18:39.000Z">
<meta property="article:modified_time" content="2021-11-03T08:23:28.549Z">
<meta property="article:author" content="Li Yudong">
<meta property="article:tag" content="机器学习初学">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://example.com/2020/08/28/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E4%BC%98%E5%8C%96%E7%AE%97%E6%B3%95/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>优化算法与计算性能 | Technological Blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Technological Blog</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">IT小白的成长之旅</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="tags fa-fw"></i>标签<span class="badge">18</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="th fa-fw"></i>分类<span class="badge">14</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="archive fa-fw"></i>归档<span class="badge">95</span></a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

  <a href="https://github.com/tiarmor1" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2020/08/28/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E4%BC%98%E5%8C%96%E7%AE%97%E6%B3%95/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/author.jpg">
      <meta itemprop="name" content="Li Yudong">
      <meta itemprop="description" content="">
    </span>
    
    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Technological Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          优化算法与计算性能
        </h1>
    
        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
    
              <time title="创建时间：2020-08-28 12:18:39" itemprop="dateCreated datePublished" datetime="2020-08-28T12:18:39+08:00">2020-08-28</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-11-03 16:23:28" itemprop="dateModified" datetime="2021-11-03T16:23:28+08:00">2021-11-03</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/" itemprop="url" rel="index"><span itemprop="name">机器学习</span></a>
                </span>
            </span>
    
          
    
        </div>
      </header>
    
    
    
    
    <div class="post-body" itemprop="articleBody">
    
      
        <h2 id="优化与深度学习"><a href="#优化与深度学习" class="headerlink" title="优化与深度学习"></a>优化与深度学习</h2><p>一般会预定义一个损失函数，再使用优化算法试图将其最小化，这样的损失函数通常被称为优化问题的目标函数，通常只考虑最小化目标函数。由于优化算法的目标函数通常是一个基于训练集的损失函数，故优化目的在于降低训练误差，而深度学习目的在于降低泛化误差，因此需要注意过拟合问题。</p>
<p>很多优化问题并不存在解析解，因此需要通过优化算法有限次迭代模型参数来尽可能降低损失函数值。</p>
<h3 id="局部最小值"><a href="#局部最小值" class="headerlink" title="局部最小值"></a>局部最小值</h3><p>当一个优化问题的数值解在局部最优解附近时，由于目标函数有关解的梯度接近或变成0，因此最终迭代可能只令目标函数局部最小化而非全局最小化。</p>
<h3 id="鞍点"><a href="#鞍点" class="headerlink" title="鞍点"></a>鞍点</h3><p>在二维空间函数中，f(x,y) = x^2 - y^2，鞍点位置是x = 0处。且在图的鞍点位置，目标函数在x轴方向上是局部最小值，但在y轴方向上是局部最大值。</p>
<p>假设函数的输入为k维向量，输出为标量，则其海森矩阵有k个特征值；可通过该函数在对应点，其海森矩阵的特征值的正负，来判断该点为：（特征值全为负）局部最大值、（特征值全为正）局部最小值，还是（特征值有正有负）鞍点。</p>
<p>而通过随机矩阵理论可知：对一个大的高斯随机矩阵来说，任一特征值为正或负的概率均为0.5，故局部最小、最大值的可能性均为(0.5)^k，目标函数的鞍点比局部最值更常见。</p>
<h3 id="梯度下降与随机梯度下降"><a href="#梯度下降与随机梯度下降" class="headerlink" title="梯度下降与随机梯度下降"></a>梯度下降与随机梯度下降</h3><p>一维梯度下降：通过用X - nf*(x)来代替x的方法，利用该式子不断迭代x，直到达到停止条件（一般为f’(x) ^2已经足够小，或者迭代次数已到达某个值）。其中正数n通常叫做学习率，为超参数，需人工设定。学习率过小：x更新缓慢，需要更多次迭代；学习率过大：可能会导致taylor展开的不等式不一定成立，迭代x不一定减小f(x)的值。</p>
<p>多维梯度下降：方向导数给出了x沿所有可能方向的变化率，为了最小化f，希望能找到f能被下降最快的方向，故利用梯度下降算法不断降低f的值。</p>
<p>随机梯度下降：n为训练数据样本数，x为模型的参数向量。则如果使用梯度下降时，会使用各个样本的平均作为，每次自变量迭代的计算开销为O(n)，随n线性增长，因此若样本数大时，每次迭代的计算开销高。而随机梯度下降减少了计算开销，在每次迭代中随机均匀采样样本索引来计算梯度，从而减少每次迭代的开销。</p>
<h3 id="小批量随机梯度下降"><a href="#小批量随机梯度下降" class="headerlink" title="小批量随机梯度下降"></a>小批量随机梯度下降</h3><p>在每次迭代，梯度下降用整个训练集来计算梯度，而小批量梯度随机下降，利用随机均匀采样一个由样本索引组成的小批量B。</p>
<p>且由于随机采样得到梯度的方差在迭代过程中无法减小，因此实际中，小批量随机梯度下降的学习率需要在迭代过程中自我衰减。</p>
<p>在Gluon中可用创建Trainer实例来调用调优算法。</p>
<h3 id="动量法"><a href="#动量法" class="headerlink" title="动量法"></a>动量法</h3><p>梯度下降又称最陡下降：自变量在当前位置下降最快的方向，在每次迭代中梯度下降根据自变量当前位置沿着梯度来更新自变量，然而，若自变量的迭代方向仅仅取决于自变量当前位置，可能会带来问题。</p>
<p>在二维或者多维的变量中，梯度下降往往难以同时兼顾学习率与确保f(x)下降；需要确保学习率较小，从而避免自变量在竖直方向越过函数最优解，但会因此导致向最优解移动缓慢。</p>
<p>动量法：设时间步t的自变量为Xt，学习率为Nt，动量法对每次迭代的步骤做出以下修改：Vt &lt;- yV(t-1)；Xt &lt;- X(t-1) - Vt。y为动量超参数，范围在[0，1）</p>
<p>指数加权移动平均：</p>
<p>由指数加权平均理解动量法：</p>
<p>相对于小批量随机梯度下降，动量法需要对每一个自变量维护一个同它一样形状的速度变量，且在超参数中多了动量超参数。</p>
<p>在Gluon中，需要在Trainer实例中通过momentum来指定动量超参数，即可使用动量法。</p>
<h3 id="AdaGrad算法"><a href="#AdaGrad算法" class="headerlink" title="AdaGrad算法"></a>AdaGrad算法</h3><p>动量法依赖指数加权移动平均，使得自变量的更新方向更加一致，从而降低自变量在梯度较大的维度发散的可能。</p>
<p>而AdaGrad算法根据自变量在每个维度的梯度大小，来调整各个维度的学习率，从而避免统一的学习率难以适应所有维度的问题。</p>
<p>AdaGrad算法会使用一个小批量随机梯度Gt按元素平方的累加变量St：</p>
<p>Gluon中使用名称为”adagrad”的Trainer实例来调用该算法训练模型。</p>
<h3 id="RMSProp算法"><a href="#RMSProp算法" class="headerlink" title="RMSProp算法"></a>RMSProp算法</h3><p>AdaGrad算法在迭代后期由于学习率过小，可能比较难找一个有用的解：因此用RMSProp算法改良后。</p>
<p>不同于AdaGrad算法里状态变量St是截至时间步t所有小批量随机梯度Gt按元素平方和。RMSProp算法将这些梯度按元素平方做指数加权移动平均，即</p>
<p>Gluon中使用名称为”rmsprop”的Trainer实例来调用该算法训练模型，且超参数由gammal指定。</p>
<p>还有AdaDelta算法、Adam算法</p>
<h2 id="深度学习计算性能"><a href="#深度学习计算性能" class="headerlink" title="深度学习计算性能"></a>深度学习计算性能</h2><h3 id="命令式和符号式混合编程"><a href="#命令式和符号式混合编程" class="headerlink" title="命令式和符号式混合编程"></a>命令式和符号式混合编程</h3><p>之前一般使用Sequential类来串联多个层，先为了使用混合式编程，使用HybridSequential类来替换Sequential类。</p>
<h3 id="异步运算"><a href="#异步运算" class="headerlink" title="异步运算"></a>异步运算</h3><p>MXNet使用异步运算来提升性能，通过前端线程与后端线程的交互进行异步运算：前端线程无需等待当前指令从后端线程返回结果就继续执行后面的指令。</p>
<p>但同样异步运算会占据额外的内存：由于深度学习模型往往比较大，且内存资源通常有限，因此在训练模型时通常使用同步函数，而不用异步运算。</p>
<h3 id="自动并行计算"><a href="#自动并行计算" class="headerlink" title="自动并行计算"></a>自动并行计算</h3><p>MXNet后端会自动构建计算图，依据该图，系统会自动知道所有计算的依赖关系。</p>
<p>包括CPU与GPU的并行计算、多GPU计算、数据并行。</p>

    </div>
    
    
    
    
    <div>
      
        <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>

      
    </div>
        <div class="reward-container">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
      
      <div style="display: inline-block;">
        <img src="/images/alipay.png" alt="Li Yudong 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>

        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>Li Yudong
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="http://example.com/2020/08/28/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E4%BC%98%E5%8C%96%E7%AE%97%E6%B3%95/" title="优化算法与计算性能">http://example.com/2020/08/28/机器学习/机器学习优化算法/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！
  </li>
</ul>
</div>

    
      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E5%88%9D%E5%AD%A6/" rel="tag"># 机器学习初学</a>
          </div>
    
        

    
        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/08/25/C++/C%E8%AF%AD%E8%A8%80%E7%A8%8B%E5%BA%8F%E8%AE%BE%E8%AE%A1/" rel="prev" title="C语言程序设计">
      <i class="fa fa-chevron-left"></i> C语言程序设计
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/08/28/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E8%AE%A1%E7%AE%97%E6%9C%BA%E8%A7%86%E8%A7%89/" rel="next" title="计算机视觉">
      计算机视觉 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#优化与深度学习"><span class="nav-number">1.</span> <span class="nav-text">优化与深度学习</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#局部最小值"><span class="nav-number">1.1.</span> <span class="nav-text">局部最小值</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#鞍点"><span class="nav-number">1.2.</span> <span class="nav-text">鞍点</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#梯度下降与随机梯度下降"><span class="nav-number">1.3.</span> <span class="nav-text">梯度下降与随机梯度下降</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#小批量随机梯度下降"><span class="nav-number">1.4.</span> <span class="nav-text">小批量随机梯度下降</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#动量法"><span class="nav-number">1.5.</span> <span class="nav-text">动量法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#AdaGrad算法"><span class="nav-number">1.6.</span> <span class="nav-text">AdaGrad算法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#RMSProp算法"><span class="nav-number">1.7.</span> <span class="nav-text">RMSProp算法</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#深度学习计算性能"><span class="nav-number">2.</span> <span class="nav-text">深度学习计算性能</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#命令式和符号式混合编程"><span class="nav-number">2.1.</span> <span class="nav-text">命令式和符号式混合编程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#异步运算"><span class="nav-number">2.2.</span> <span class="nav-text">异步运算</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#自动并行计算"><span class="nav-number">2.3.</span> <span class="nav-text">自动并行计算</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Li Yudong"
      src="/images/author.jpg">
  <p class="site-author-name" itemprop="name">Li Yudong</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">95</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">14</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">18</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/tiarmor1" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;tiarmor1" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:1157019137@qq.com" title="E-Mail → mailto:1157019137@qq.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>
  <div class="cc-license motion-element" itemprop="license">
    <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" rel="noopener" target="_blank"><img src="/images/cc-by-nc-sa.svg" alt="Creative Commons"></a>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 2020 – 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Li Yudong</span>
</div>

        








      </div>
    </footer>
  </div>

  
  
  <script color='0,0,0' opacity='0.5' zIndex='-1' count='150' src="/lib1/canvas-nest/canvas-nest.min.js"></script>
  <script src="/lib1/anime.min.js"></script>
  <script src="/lib1/velocity/velocity.min.js"></script>
  <script src="/lib1/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  

  
   <canvas class="fireworks" style="position: fixed;left: 0;top: 0;z-index: 1; pointer-events: none;" ></canvas> 
   <script type="text/javascript" src="//cdn.bootcss.com/animejs/2.2.0/anime.min.js"></script> 
   <script type="text/javascript" src="/js/fireworks.js"></script>
  
</body>
</html>

